<include file="Public/head"/>
<style type="text/css">
    .focus-btn, .new_btn {
        width: 80px;
        border-radius: 3px;
        color: #fff;
        margin-left: 7px;
        padding: 0;
        background-color: #20ab4f;
        border: medium none;
    }
    .new_btn {padding: 3px;}

    .chenggong1 .paidan {
        padding-top: 30px;
    }

    .paidan h3 {
        font-size: 16px;
        color: #000;
        margin-bottom: 30px;
    }

    input[name="t_name"],input[name="t_id"] {
        border: 1px solid #d7d7d7;
        float: left;
        height: 24px;
        line-height: 24px;
        margin: 0 10px 10px 0;
        text-align: center;
        width: 150px;
    }
</style>
</head>
<include file="Public/common_header"/>
<div class="mian">
    <include file="Public/sidebar" menu="clcwht.ztgl"/>

    <div class="mianR">

        <div class='clearfix' style="margin: 12px 0;">
            <form id="searchFrom">
                <input type="text" name="t_id" placeholder="请输入专题ID" class=""/>
                <input type="text" name="t_name" placeholder="请输入专题名称关键字" class=""/>
                <input type="text" name="start_time" placeholder="开始时间" value="" class="xiaci xin-text1"
                       id="start_time" readonly/>
                <input type="text" name="end_time" placeholder="结束时间" value="" class="xiaci xin-text1"
                       id="end_time" readonly/>
                <input type="button" value="筛选" name="focus_search" class="focus-btn"/>
            </form>
            <div style="float:left;width:100%;height:30px;padding-top: 8px;">
                <input type="button" value="新建专题" id="create_new" class="new_btn" style="float:left;"/>
            </div>
        </div>
        <div class="yunBei"></div>
        <div class="yuList">
            <div class="listBox" id="listBox"></div>
        </div>
    </div>
    <div class="clear"></div>
    <script type="text/javascript">
        $("#create_new").on('click', function () {
            window.location.href = "/Topic/addTopic"
        });
        get_list();
        function get_list() {
            var url = mkUrl();
            $.get("/Topic/topicList", url, function (data) {
                $("#listBox").html(data);
            }, "html");
        }
        function get_page(p) {
            var url = mkUrl();
            $.get("/Topic/topicList/" + encodeURI("p/" + p), url, function (data) {
                $("#listBox").html(data);
            }, "html");
        }

        $("input[name='focus_search']").click(function () {
            get_list();
        });

        function mkUrl() {
            var url = "";
            var t_id = $("input[name='t_id']").val();
            var t_name = $("input[name='t_name']").val();
            var start_time = $("input[name='start_time']").val();
            var end_time = $("input[name='end_time']").val();
            if (t_id) {
                url += '&t_id=' + t_id;
            }
            if (t_name) {
                url += '&t_name=' + t_name;
            }
            if (start_time) {
                url += '&start_time=' + start_time;
            }
            if (end_time) {
                url += '&end_time=' + end_time;
            }
            return url;
        }

        $("#start_time").ymdateplugin({
            showTimePanel: true,
            changeMonth: true,
            changeYear: true
        });
        $("#end_time").ymdateplugin({
            showTimePanel: true,
            changeMonth: true,
            changeYear: true
        });
    </script>
    <include file="Public/foot"/>
